import request from '@/utils/request'
// 导入服务奖罚明细列表
export function fwjfImport (query) {
  return request({
    url: '/dwxc/maintenance/importData',
    method: 'post',
    params: query
  })
}
// 查询服务奖罚明细列表
export function fwjflist (query) {
  return request({
    url: '/dwxc/maintenance/list',
    method: 'get',
    params: query
  })
}


// 各区县总薪酬统计（首页）
export function salaryStatistics (query) {
  return request({
    url: '/maintainerSalary/salaryStatistics',
    method: 'get',
    params: query
  })
}
// 获取薪资明细列表
export function salaryDetail (query) {
  return request({
    url: '/maintainerSalary/salaryDetail',
    method: 'get',
    params: query
  })
}
// 获取各区县月均薪资环比
export function getSalarybyDistrict(query) {
  return request({
    url: '/maintainerSalary/salaryRatio',
    method: 'get',
    params: query
  })
}

// 获取各类薪酬占比（首页）
export function getSalaryPercentage(query) {
  return request({
    url: '/maintainerSalary/getSalaryPercentage',
    method: 'get',
    params: query
  })
}

// 获取一线维护人员薪酬列表
export function listSalary(query) {
  return request({
    url: '/salary/getSalary',
    method: 'get',
    params: query
  })
}
// 获取all salary
export function allSalary(query) {
  return request({
    url: '/salary/getAll',
    method: 'get',
    params: query
  })
}

// 获取存量维护家宽salary
export function homeBroadBand(query) {
  return request({
    url: '/salary/homeBroadband',
    method: 'get',
    params: query
  })
}

// 获取存量维护企宽salary
export function bizBroadband(query) {
  return request({
    url: '/salary/bizBroadband',
    method: 'get',
    params: query
  })
}

// 获取新装按次家宽salary
export function newHome(query) {
  return request({
    url: '/salary/newHome',
    method: 'get',
    params: query
  })
}

// 获取新装按次企宽salary
export function newBiz(query) {
  return request({
    url: '/salary/newBiz',
    method: 'get',
    params: query
  })
}

// 获取上门整治
export function rectify(query) {
  return request({
    url: '/salary/rectify',
    method: 'get',
    params: query
  })
}

// 获取服务奖罚
export function serviceRewardPenalty(query) {
  return request({
    url: '/salary/serviceRewardPenalty',
    method: 'get',
    params: query
  })
}

// 获取金银铜
export function medalLevel(query) {
  return request({
    url: '/salary/medalLevel',
    method: 'get',
    params: query
  })
}

// 获取激励包分配
export function incentivePackage(query) {
  return request({
    url: '/salary/incentivePackage',
    method: 'get',
    params: query
  })
}

// 获取平均薪酬统计
export function aveSalary(query) {
  return request({
    url: '/maintainerSalary/avgSalaryByMonth',
    method: 'get',
    params: query
  })
}

// 获取平均薪酬环比率
export function MomSalary(query) {
  return request({
    url: '/maintainerSalary/getMoM',
    method: 'get',
    params: query
  })
}
// 获取总薪酬环比率
export function totalMomSalary(query) {
  return request({
    url: '/maintainerSalary/getTotalMoM',
    method: 'get',
    params: query
  })
}

// 获取网格月均薪酬
export  function avgWangge(query){
  return request({
    url: '/maintainerSalary/gridAvgSalaryByMonth',
    method: 'get',
    params: query
  })
}
// 获取网格薪酬环比
export  function monWangge(query){
  return request({
    url: '/maintainerSalary/getGridMoM',
    method: 'get',
    params: query
  })
} 

 
// 查询各区县/网格该月的人均激励总额
export  function averageIncentive(query){
  return request({
    url: '/salesIncome/queryTotalIncentiveMonthlyAverage',
    method: 'get',
    params: query
  })
} 
// 查询各区县/网格该月的激励总额
export  function totalIncentive(query){
  return request({
    url: '/salesIncome/queryTotalIncentive',
    method: 'get',
    params: query
  })
} 



// 上传文件
export function uploadFile(params) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: params,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 导入文件
export function importData(params) {
  return request({
    url: '/salary/import',
    method: 'get',
    params
  })
}
export function delIncome(ids) {
  return request({
    url: `/salary/${ids.join(',')}`,
    method: 'delete'
  })
}

export function delsalaryIncome(ids) {
  return request({
    url: `/salesIncome/${ids.join(',')}`,
    method: 'delete'
  })
}

// 薪酬分阶占比导出
export function exportSalaryDetail(params) {
  return request({
    url: '/maintainerSalary/exportSalaryDetail',
    method: 'get',
    params
  })
}
